//
//  AVPViewController.m
//  MyzcApp
//
//  Created by myzc on 16/6/16.
//  Copyright © 2016年 myzc. All rights reserved.
//

#import "AVPViewController.h"
#import <MediaPlayer/MediaPlayer.h>
#import <AVFoundation/AVFoundation.h>
#import <AVKit/AVKit.h>

@interface AVPViewController ()
@property (strong, nonatomic) AVPlayer *avplayer;
@end

@implementation AVPViewController

- (void)viewDidLoad {
    [super viewDidLoad];    
    // Do any additional setup after loading the view.
    
    
    NSURL *url = [NSURL URLWithString:self.model.link];
    
    AVPlayerViewController * play = [[AVPlayerViewController alloc]init];
    play.player = [[AVPlayer alloc]initWithURL:url];
    play.view.frame = self.view.frame;

    [self.view addSubview:play.view];
    [self addChildViewController:play];
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
